﻿using UnityEngine;

namespace Zero.Dialogue
{
    public class TimelineDialogue : MonoBehaviour
    {
        private string _characterName;
        private string _body;

        public void SetDialogueCharacterName(string characterName)
        {
            _characterName = characterName;
        }

        public void SetDialogueBody(string body)
        {
            _body = body;
        }

        /// <summary>
        /// 更新对话框
        /// </summary>
        public void UpdateDialogue()
        {
            DialogueSystem.Instance.SetDialogueText(_characterName, _body);
        }

        /// <summary>
        /// 关闭对话框
        /// </summary>
        public void CloseDialogue()
        {
            DialogueSystem.Instance.ToggleDialoguePanel(false);
        }
    }
}